<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="common/head :: head"></head>
<script type="text/javascript">
  $(function(){
    $("#areaId").bind("change",function() {
      var areaId = $("#areaId").val();
      $("#plateId").empty();
      $.get("/dict/findListByParentId/" + areaId,function(response) {
        var res = JSON.parse(response)
        $.each(res.data, function(i,item) {
          $("<option></option>").val(item.id).text(item.name).appendTo("#plateId");
        });
      });
    });
  });
</script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
  <div class="ibox float-e-margins">
    <div class="ibox-content" style="width: 98%;">
      <form id="ec" action="/community/save" method="post" class="form-horizontal">
        <div class="form-group">
          <label class="col-sm-2 control-label">小区名称：</label>
          <div class="col-sm-10">
            <input type="text" name="name" id="name" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">描述：</label>
          <div class="col-sm-10">
            <input type="text" name="description" id="description" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">区域：</label>
          <div class="col-sm-10">
            <select name="areaId" id="areaId" class="form-control">
              <option value="">-请选择-</option>
              <option th:each="item,it : ${areaList}" th:text="${item.name}" th:value="${item.id}">-选择区域-</option>
            </select>
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">板块：</label>
          <div class="col-sm-10">
            <select name="plateId" id="plateId" class="form-control">
              <option value="">-请选择-</option>
            </select>
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">详细地址：</label>
          <div class="col-sm-10">
            <input type="text" name="address" id="address" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">建筑年代：</label>
          <div class="col-sm-10">
            <input type="text" name="buildYears" id="buildYears" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">物业价格(元/平)：</label>
          <div class="col-sm-10">
            <input type="text" name="propertyPrice" id="propertyPrice" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">物业公司：</label>
          <div class="col-sm-10">
            <input type="text" name="propertyCompany" id="propertyCompany" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">开发商：</label>
          <div class="col-sm-10">
            <input type="text" name="developer" id="developer" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">楼栋数：</label>
          <div class="col-sm-10">
            <input type="text" name="buildNum" id="buildNum" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">房屋数：</label>
          <div class="col-sm-10">
            <input type="text" name="houseNum" id="houseNum" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <label class="col-sm-2 control-label">均价(万元/平)：</label>
          <div class="col-sm-10">
            <input type="text" name="averagePrice" id="averagePrice" class="form-control" />
          </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
          <div class="col-sm-4 col-sm-offset-2 text-right">
            <button class="btn btn-primary" type="submit">确定</button>
            <button class="btn btn-white" type="button" onclick="javascript:opt.closeWin();" value="取消">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
</body>
</html>